import React from "react";

import PageContent from '../../PageContent';

import { ajax, openErrorNotification, openSuccessNotification, showResultMessage, isNotNull, isNull } from '../../common';

import StudentDataTablePanel from './StudentListDataTablePanel';

/** 
 * 课程定义管理
*/
export default class StudentManageApp extends React.Component {
	constructor(props) {
		super(props);
		this.state = {
			currentTabKey: null,
		}
    }
    
    actionHandler = (actionEvent,panelInstance) => {

		return {
						        
			refresh : () => {
				panelInstance.loadData();
			},
									        
			addNew : () => {
				panelInstance.addNew();
			},
									        
			doDelete : () => {
				panelInstance.doDelete(isNotNull(actionEvent.params) ? actionEvent.params.id : null);
			},
													
			doEdit : () => {
				panelInstance.doEdit(actionEvent.params);
			},						
			doSave : () => {
				panelInstance.doSave();
			},
												
		};
	}

	render() {
        return (
            <PageContent {...this.props} pageInstance={this} >
                <StudentDataTablePanel actionHandler={this.actionHandler}/>
            </PageContent>
        );
    }
}